<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title><?php echo ($goodsdetail[goodsname]); ?></title>
     <script type='text/javascript' src='/php/x-admin/Public/home/js/jquery.js'></script>
    <meta name="Keywords" content="书">
    <link href="/php/x-admin/Public/home/css/public.css" rel="stylesheet" type="text/css">
    <link href="/php/x-admin/Public/home/css/product_detail.css" rel="stylesheet" type="text/css">
    <link href="/php/x-admin/Public/home/css/yiguo.css" rel="stylesheet" type="text/css">

    <script src="/php/x-admin/Public/home/js/jquery_002.js"></script>
    <script src="/php/x-admin/Public/home/js/base.js"></script>
</head>
<body id="body">

    <div class="w w1280">
        <div id="topads">
            </div>
        <!--页头-->
        <!-- 顶部工具栏 -->
<div class="site-nav">
    <div class="wrap">
        <ul class="fl">
            <li>欢迎光临！</li>
        </ul>

        <ul class="fr">

            <li class="mobile">
                <div class="tit"><a href="/php/x-admin/index.php/Home/Index/index">首页</a></div>

            </li>

            <?php if($V=SESSION('username')): ?><li id="_loginname" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Collect/index">我的收藏</a>
                </li>
                <li style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/User/index">会员中心</a>
                </li>
                <li style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Cart/index/goodsNum/1">去购物车</a>
                </li>
                <li id="_logout" style="">
                    <a href="/php/x-admin/index.php/Home/Login/logout" class="logout">[退出]</a>
                </li>
                <li style="">
                    <a rel="nofollow"><?php echo ($V); ?></a>
                </li>
                <?php else: ?>
                <li id="_register" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Register/index">[注册]</a>
                </li>
                <li id="_login" style="">
                    <a rel="nofollow" href="/php/x-admin/index.php/Home/Login/index">[登录]</a>
                </li><?php endif; ?>
        </ul>
    </div>
</div>
<!------- 头部 ------>
<div class="header clearfix">
    <div class="wrap">
        <div class="logo">
            <a href="/php/x-admin/index.php/Home/Index/index"></a>
        </div>
        <!--搜索 开始-->
        <div class="search" style="position:relative;">
            <div class="search-bar clearfix">
                <form action="/php/x-admin/index.php/Home/Search/index" method="get" onsubmit="return fun()">
                    <input type="text"  id="inputid" name="keyword" class="search-input" value="" placeholder="请输入商品名">
                    <input class="search-btn" type="submit" value="搜索">
                    <script type="text/javascript">
                        function fun(){
                            var inputid=document.getElementById('inputid');
                            ss=inputid.value;
                            if(!ss){
                                return false;
                            }
                        }
                    </script>
                </form>
            </div>


        </div>

    </div>
</div>



<div class="header-nav">
    <div class="wrap">
        <!--商品分类 开始-->
        <div class="catalogs">
            <div class="catalogs-title"><a href="javascript:;">全部商品分类▼</a></div>
            <div class="catalogs-list" id="_categry" style="display:none;">
                <!-- 遍历顶级分类 -->
                <?php if(is_array($type)): foreach($type as $key=>$cats): ?><div class="item">
                        <h3 class="t01_channelhome"><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($cats["catsid"]); ?>"><i></i><?php echo ($cats["catsname"]); ?><s>&gt;</s></a></h3>
                        <div class="sub-item">
                            <h4><a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/<?php echo ($cats["catsid"]); ?>"><?php echo ($cats["catsname"]); ?></a></h4>
                            <div class="sub-list">
                                <!--遍历子分类-->
                                <?php if(is_array($cats['subcat'])): foreach($cats['subcat'] as $key=>$cat): ?><a href="/php/x-admin/index.php/Home/Goodslist/index/soncatsid/<?php echo ($cat["catsid"]); ?>/catsname/<?php echo ($cat["catsname"]); ?>" target="_self"><?php echo ($cat["catsname"]); ?></a><?php endforeach; endif; ?>
                            </div>
                            <div class="catalogs-ad">
                                <a href="/php/x-admin/index.php/Home/Goodslist/index/catsid/$cats['catsid']"><img style="width:215px;" src="/php/x-admin/public/home/imgs/yangguang.jpg" alt="$cats['catsname']"></a>
                            </div>
                        </div>
                    </div><?php endforeach; endif; ?>
                <!-- 分类结束 -->

            </div>
        </div>
        <!--商品分类 结束-->

        </div>
    </div>
</div>

<div class="wrap">
    <!--面包屑-->
    <div class="crumbs">
        <?php echo ($here); ?>
    </div>
    <!--产品详情-->
    <div class="content clearfix">
        <div class="product-intro clearfix j_product">
            <!--预览图-->
            <div class="pic-preview">
                <div class="pic-big">
                    <img class="j_product_img" src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" style="display:  block;" height="500" width="500">
                    <img class="j_product_img" src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" style="display: none;" height="500" width="500">
                    <img class="j_product_img" src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" style="display: none;" height="500" width="500">
                </div>
                <div class="pic-thumb">
                    <div class="picList">
                        <ul>
                            <li><img src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" height="85" width="85"></li>
                            <li><img src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" height="85" width="85"></li>
                            <li><img src="/php/x-admin/Public/Upload/<?php echo ($goodsdetail["goodspic"]); ?>" height="85" width="85"></li>
                        </ul>
                    </div>
                </div>

            </div>
            <div class="product-info">
                <div class="summary-name">
                    <h1>&nbsp;<?php echo ($goodsdetail["goodsname"]); ?></h1>
                    <p></p> 
                    <input name="CommodityId" id="CommodityId" value="" type="hidden">
                </div>
                <div class="summary-price clearfix">
                    <div class="pro-price">
                        <div>
                            <span>价格：</span>
                            <span><em>¥</em><strong>
                            <?php echo ($goodsdetail["price"]); ?>
                            </strong></span>
                        </div>
                            <div class="mt5">
                                <span>原价：</span>
                                <span><del>¥<?php echo ($goodsdetail["oldprice"]); ?>/册</del></span>
                            </div>
                    </div>
                    <div class="pro-review">
                        <p>总体满意度</p>
                        <p><b>4.2</b> 分</p>
                        <p><a href="#comment" id="pllabel"><span></span></a></p>
                    </div>
                </div>
                <div class="summary-other clearfix">
                    <div class="left">
<div class="pro-promo clearfix" style="margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px dashed rgb(217, 217, 217);">
    <ul>
    </ul>
</div>

                        <div class="pro-service">满百包邮，<b>20:00</b> 前完成订单，预计后天<b></b>送达</div>
                        <div class="pro-amount clearfix">
                            <div class="dt">数量：</div>
                            <div class="dd">
                                <?php if($goodsdetail["store"] == 0): ?><div maxlength="2" class="spinner value">
                                        <button class="decrease">-</button>
                                        <input value="0" class="spinner value"  maxlength="2" type="text" disabled>
                                        <button class="increase">+</button>
                                    </div>
                                    <?php else: ?>
                                    <div maxlength="2" class="spinner value">
                                        <button class="decrease" onclick="func()">-</button>
                                        <input value="1" class="spinner value" id="number" maxlength="2" type="text" disabled>
                                        <button class="increase" onclick="fun()">+</button>
                                    </div><?php endif; ?>

                              

                            <div class="addcart" id='a'>
                                <?php if($goodsdetail["store"] == 0): ?><a class="btn-gn"  href="#" ><i></i>暂时无货</a>
                                    <?php else: ?>
                                        <?php if($V=SESSION('username')): ?><a class="btn-gn" href="javascript:;" onclick="addCart(<?php echo ($goodsdetail["goodsid"]); ?>)"><i></i>加入购物车</a>
                                        <?php else: ?>
                                            <a class="btn-gn" href="javascript:;" onclick="alert('请登录')"><i></i>加入购物车</a><?php endif; endif; ?>
                            </div>
                            </div>
                              <script type="text/javascript">
                                function fun(){
                                    var num=document.getElementById('number');
                                    num.value ++; 
                                    if(num.value >= <?php echo ($goodsdetail["store"]); ?>){
                                        num.value = <?php echo ($goodsdetail["store"]); ?>;
                                    }
                                     //console.log(a.href);
                                }

                                function func(){
                                    var num=document.getElementById('number');
                                    num.value --;
                                    if(num.value <= 1){
                                        num.value = 1;
                                    }
                                }

                                
                                </script>

                        </div>
                        <div class="pro-share clearfix">
                            <div class="favorite"><a href="/php/x-admin/index.php/Home/collect/add/goodsid/<?php echo ($goodsdetail["goodsid"]); ?>" onclick="G.app.cart.module.addToFavor('67ef74af-36e9-4f71-b724-71992fdf7e07',1)"><i></i>收藏</a></div>
                        </div>

                        
                    </div>
                    <div class="right">
                        <table class="zx" width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tbody style="font-size:11px">
                                <tr style="color:grey;"><th>商品编号：</th><td><?php echo ($goodsdetail["goodsNo"]); ?></td></tr>
                                <tr><th style="color:grey;">商品状态：</th><td><font color="2CA6E0">
                                <?php if($goodsdetail["store"] == 0): ?>缺货
                                    <?php else: ?>
                                    有货<?php endif; ?>
                                </font></td></tr>
                                <tr style="color:grey;"><th>库存：</th><td><?php echo ($goodsdetail["store"]); ?></td></tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="content clearfix">
        <!--左侧-->
        <div class="left-con">

            <div class="box recommend">
                <div class="hd">猜你喜欢</div>
                <div class="bd">
                    <?php if(is_array($go)): foreach($go as $key=>$go): ?><div class="p j_product">
                            <div class="img">
                                <a href="/php/x-admin/index.php/Home/Goodsdetail/index/goodsid/<?php echo ($go["goodsid"]); ?>" target="_blank">
                                        <img src="/php/x-admin/Public/Upload/<?php echo ($go["goodspic"]); ?>" class="j_product_img" height="68" width="68">

                                </a>
                            </div>
                            <div class="txt">
                                <a href="#" target="_blank">
                                    <strong><?php echo ($go["goodsname"]); ?></strong>
                                    <span>¥<?php echo ($go["price"]); ?></span>
                                </a>
                            </div>
                        </div><?php endforeach; endif; ?>

                </div>
            </div>

        </div>
        <!--右侧-->
        <div class="main-con">
            <!--当季热卖-->


    <div class="hot-sale">
        <div class="hd">当季热卖</div>
        <div class="bd clearfix">
            <ul>
            <?php if(is_array($new)): foreach($new as $key=>$new): ?><li>
                        <div class="p-img">
                            <a href="/php/x-admin/index.php/Home/Goodsdetail/index/goodsid/<?php echo ($new["goodsid"]); ?>" target="_blank">
                               <img src="/php/x-admin/Public/Upload/<?php echo ($new["goodspic"]); ?>" height="135" width="135">
                            </a>
                        </div>
                        <div class="p-name"><a href="#" target="_blank"><?php echo ($new["goodsname"]); ?></a></div>
                        <div class="p-price">
                            <strong>¥<?php echo ($new["price"]); ?></strong>
                        </div>
                    </li><?php endforeach; endif; ?>
            </ul>
        </div>
    </div>

            <!--商品详情-->
            <div class="product-detail" >
                <div class="detail-tab">
                    <ul class="detail-ul" id='li'>
                        <li data='0' style='cursor:pointer'><a>商品详情</a></li>
                        <li data='1' style='cursor:pointer'><a>用户评价<b></b></a></li>
                    </ul>

                </div>
                <div class="detail-content">

                    <!--商品详情================================================================================-->
                    <div class="detail-item details clearfix" id="details">
                    <?php echo ($goodsdetail["description"]); ?>
                    </div>


                    <!--用户评价==================================================================================-->
                     
                       <div class="detail-item" id="comment">
                        <div class="comment-info clearfix">
                            <div class="score">总体满意度<b>4.3<span>分</span></b></div>
                            <div class="percent">
                                <ul class="slip">
                                    <li><b>好评</b><span w="89%" style="width: 89%;"></span><i>89%</i></li>
                                    <li><b>中评</b><span w="11%" style="width: 11%;"></span><i>11%</i></li>
                                    <li><b>差评</b><span w="0%" style="width: 0%;"></span><i>0%</i></li>
                                </ul>
                            </div>
                            <div class="comment-btn">
                                <p>只有购买过该商品的用户才能评价</p>
                            </div>
                        </div>
                        <div class="comment-list clearfix">

                            <div id="ProductCommentVote">
                                <div _votetype="0">
 <?php if(is_array($comment)): foreach($comment as $key=>$comment): ?><div class="comment-con" style="display:block;">
        <ul>
                <li>
                    <div class="comment-item" _voteid="3dd8cc32-e0a4-45d7-8ae8-cd7266ebaf55" _userid="93f3a1d4-f323-462e-97ec-959637e7a77f">
                        <div class="user">
                            <img src="/php/x-admin/public/home/imgs/nophoto.gif" width="60" height="60">
                            <span class="name"><?php echo ($comment["user_name"]); ?></span>
                            <span class="level">普通用户</span>
                        </div>
                        <div class="content-comment">
                            <div class="heading">

                                 
                                 <div class="date">评价时间:<?php echo ($comment["commenttime"]); ?></div>
                            </div>

                            <div class="reply">
                                <?php echo ($comment["content"]); ?>
                                <br>
                                <div class="reply-images">

                                </div>
                                <div class="reply-image-big"><img src="" width="500" height="500"></div>
                            </div>
                            <?php if($comment["rcon"] != null): ?><span style='color:red'>回复:</span>
                            <br><span>回复时间:<?php echo ($comment["rtime"]); ?></span>
                                <div class="reply">
                                  <?php echo ($comment["rcon"]); ?>
                                <br>

                            </div><?php endif; ?>
                        </div>
                    </div>

                </li>


        </ul>

        
</div><?php endforeach; endif; ?>
</div>

                            </div>
                        </div>

                    </div>
                
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('.detail-content>div').css('display','block').eq(1).css('display','none');

        $('#li>li').click(function(){      
          var num=$(this).attr("data");
        $('.detail-content>div').css('display','none').eq(num).css('display','block');
            
        })

    });

    //加入购物车
    function addCart(id){
        //获取商品的数量，赋值给变量m
        var m = $("#number").val();
        $.ajax({
            //定义url
            url:"/php/x-admin/index.php/Home/Cart/ajax",
            //数据的提交方式
            type:"post",
            //返回数据的格式
            dataType:"json",
            //需要提交的数据
            data:{'id':id,'m':m},
            //提交成功后对返回数据进行判断
            success:function(data){
                if(data==0){
                    alert("添加失败");
                    return false;
                }else{
                    alert("添加成功");
                }
            }
        });
        return true;
    }
</script>



    <!------- 页尾 ------>
    <!------- 页尾 ------>
<div style="clear:both;"></div>
<div class="footer" style="margin-top: 20px;">
    <div class="wrap" style="margin:0 auto ;">

        <div class="service"><span>联系电话：010-62137141(传真) 62131450 电子邮箱:changchunying@tom.com</span><span>周一至周五 9:00-17:30</span></div>
        <div class="copyright">
            <p>所有图片均受著作权保护，未经许可任何单位与个人不得使用、复制、转载、摘编，违者必究法律责任。</p>
            <p>京ICP备09113557号 北京金企鹅文化发展中心版权所有</p>

        </div>
    </div>
</div>


        <!------- 侧边悬浮 ------->
        <div class="sidebar" id="sidebar">
            <a href="#body" class="s-btn goTop"></a>
            
        </div>


</body>
</html>